﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectDetial.aspx.cs" Inherits="WebApplication2.Web.ProjectDetial" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    <script src="../../lib/layui/layui.js"></script>
    <link href="../../css/font.css" rel="stylesheet" />
    <link href="../../css/xadmin.css" rel="stylesheet" />
    <script src="../../js/jquery-3.2.1.min.js"></script>
    <script src="../js/public.js"></script>
    <script src="../js/xadmin.js"></script>
    <script src="../js/cookie.js"></script>
    <title>项目详细</title>
</head>
<body>

    <style>
        body {
            display: flex;
            flex-direction: column;
            background: #f2F2f2 no-repeat fixed top;
        }

        #xx-body {
            align-self: center;
        }


        .layui-form-mid {
            font-family: '微软雅黑';
            font-size: 25px;
        }

        .content {
            font-family: '微软雅黑';
            font-size: 15px;
            color: dimgray;
        }
    </style>

    <div class="x-body layui-anim layui-anim-up " id="xx-body">
        <form class="layui-form" action="">

            <div class="layui-form-item">
                <label class="layui-form-label">
                   项目名
                </label>
             <%--   <div class="layui-form-mid">
                    <span class="content" id="name"></span>
                </div>--%>
                   <div class="layui-input-block">
                   <span class="content" id="name"></span>
                </div>
            </div>

            <div class="layui-form-item">
                <label class="layui-form-label">选择框</label>
                <div class="layui-input-block" id="sel1">
                    <select lay-verify="required" id="sel">
                        <option value="">请选择</option>
                        <option value="1">置为"策划中"</option>
                        <option value="2">置为"设计中"</option>
                        <option value="3">置为"加工中"</option>
                        <option value="4">置为"调试中"</option>
                        <option value="5">置为"已完成"</option>
                        <option value="6">置为"暂停"</option>
                    </select>
                </div>
            </div>

            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <br>
            <div class="layui-form-item">
                <div class="layui-input-block">
                    <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
                </div>
            </div>


        </form>
    </div>

    <script>
        layui.use(['layer', 'form'], function () {
            var layer = layui.layer;
            var form = layui.form;

            //监听提交
            form.on('submit(formDemo)', function (data) {

                var res = JSON.stringify(data.field)
                console.log($("#sel").val());

                var obj = new Object();
                obj.oprator = 'admin';
                obj.name = getCookie("name");
                obj.status = getCookie("status");
                obj.setstatus = $("#sel").val();
                obj.id = getCookie("id");

                myAjax("projectHandler.ashx", "updateProject", obj, true, function (data) {
                    if (data.Code == 1) {
                        layer.msg('修改完成');
                        window.opener = null;
                        window.open("", "_self").close();
                    }
                });
                return false;
            });

            $("#name").text(getCookie("name"));
            //if (getCookie("status") == 0) {
            //    console.log('status:' + getCookie("status"));
            //   // $("#status").append("<option value='1'>设计中</option>");
            //   // $(".select1").append("<option value='值1'>值1</option>");//添加option
            //   //$("#status").append("<option value=2>加工中</option>");  
            //   //$("#status").append("<option value=3>装备调试</option>");  
            //   //$("#status").append("<option value=4>已完成</option>");  
            //    var value = 'value';
            //    var text = 'text';
            //    $("select").append("<option value='" + value + "'>" + text + "</option>");

            //} else if (getCookie("status")==1) {
            //    $("#status").append("<option value=2>加工中</option>");  
            //    $("#status").append("<option value=3>装备调试</option>");  
            //    $("#status").append("<option value=4>已完成</option>");  

            //} else if (getCookie("status")=2) {
            //    $("#status").append("<option value=3>装备调试</option>"); 
            //    $("#status").append("<option value=4>已完成</option>");  

            //} else if (getCookie("status")=3) {
            //    $("#status").append("<option value=4>已完成</option>"); 
            //} else if (getCookie(status == 4)) {

            //}
        });
    </script>
</body>
</html>
